﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using WebTest.Core.Entities;

namespace WebTest.Infrastructure.Data.Config
{
    public class AddressConfiguration : IEntityTypeConfiguration<Address>
    {
        public void Configure(EntityTypeBuilder<Address> builder)
        {
            builder.Property(b => b.Alias)
                .IsRequired()
                .HasMaxLength(200);

            builder.Property(b => b.Detail)
                .IsRequired()
                .HasMaxLength(500);

            builder.Property(b => b.Province)
                .HasMaxLength(50);

            builder.Property(b => b.City)
                .HasMaxLength(50);

            builder.Property(b => b.Area)
                .HasMaxLength(50);
        }
    }
}
